﻿<%- include('../includes/head.ejs') %>

</head>
<body>

<%- include('../includes/navigation.ejs') %>
    <main>
        <% if( products.length > 0) { %>
            <ul>
                <% products.forEach(product => { %>
                    <li>
                        <p>
                            <%= p.productData.title %> (<%= p.qty %>)
                            <form action="/cart-delete-item" method="post">
                            <input type="hidden" value="<%= p.productData.id %>" name="productId" />
                            <button class="btn" type="submit">
                                Delete
                            </button>
                        </form>
                        </p>
                    </li>
                <% }) %>
            </ul>
        <% }else{%>
            <h1>No Products in Cart!</h1>
        <% } %>
    </main>
<%- include('../includes/end.ejs') %>